<template>
  <div>
    <el-container>
      <el-header>Header</el-header>
      <el-container>
        左侧内容区域
        <el-aside width="200px">
          <el-tabs :tab-position="left" v-model="activeName" type="card" @tab-click="handleClick">
            <el-tab-pane label="基本信息" name="1"></el-tab-pane>
            <el-tab-pane label="更多信息" name="2"></el-tab-pane>
          </el-tabs>
          <div class="tab-content">
            <keep-alive>
              <component :is="curTabcompnents[activeName]"></component>
            </keep-alive>
          </div>
        </el-aside>
        <el-main>Main</el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import EmpBasic from './EmpBasic.vue'
import EmpMore from './EmpMore.vue'
export default {
  data() {
    return {
      activeName: '1',
      curTabcompnents: {
        1: 'EmpBasic',
        2: 'EmpMore'
      }
    }
  },
  components: { EmpBasic, EmpMore },
  methods: {
    handleClick(tab) {
      this.activeName = tab.name
    }
  }
}
</script>
